package com.wh.usercenter3.mapper;

import com.wh.usercenter3.pojo.UserTeam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 18141
* @description 针对表【user_team(用户队伍关系)】的数据库操作Mapper
* @createDate 2025-02-25 15:44:19
* @Entity com.wh.usercenter3.pojo.UserTeam
*/
@Mapper
public interface UserTeamMapper extends BaseMapper<UserTeam> {

    /**
     * 根据teamId返回所有加入过的userId
     * @param teamId
     * @return
     */
    @Select("select userId from user_team where teamId=#{teamId} and isDelete!=1 order by joinTime")
    List<Long> getUsersIdByTeamId(long teamId);
}




